

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="John Doe">
  <meta name="keywords" content="">
  <meta name="description" content="docx库Table踩坑介绍最近工作中遇到了需要导出word文档的需求，只是简单的将列表详情的数据导出成word中的表格。类似于下面的效果：    标题 内容    标题 内容   标题 内容   之后找到了相关的工具库docx。功能强大，他封装了word中的相关模块的构造方法，只需要简单的创建一个对象就可以生成word文档。其中的一些构造方法有Document、Table、Paragraph、T">
<meta property="og:type" content="article">
<meta property="og:title" content="docx库Table踩坑">
<meta property="og:url" content="http://yoursite.com/2022/11/11/docx%E5%BA%93Table%E8%B8%A9%E5%9D%91/index.html">
<meta property="og:site_name" content="Food-Billboard">
<meta property="og:description" content="docx库Table踩坑介绍最近工作中遇到了需要导出word文档的需求，只是简单的将列表详情的数据导出成word中的表格。类似于下面的效果：    标题 内容    标题 内容   标题 内容   之后找到了相关的工具库docx。功能强大，他封装了word中的相关模块的构造方法，只需要简单的创建一个对象就可以生成word文档。其中的一些构造方法有Document、Table、Paragraph、T">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/docx-1.jpg">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/docx-2.jpg">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/docx-3.jpg">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/docx-4.jpg">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/emoji-1.jpg">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/表格大小.jpg">
<meta property="og:image" content="http://yoursite.com/images/docx库Table踩坑/docx-5.jpg">
<meta property="article:published_time" content="2022-11-11T03:20:00.000Z">
<meta property="article:modified_time" content="2022-11-15T05:46:59.000Z">
<meta property="article:author" content="John Doe">
<meta property="article:tag" content="docx word">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="http://yoursite.com/images/docx库Table踩坑/docx-1.jpg">
  
  <title>docx库Table踩坑 - Food-Billboard</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","version":"1.8.12","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname"}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<!-- hexo injector head_end start -->
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/bynotes/texiao/source/css/toubudaziji.css"></link>
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/bynotes/texiao/source/css/shubiao.css"></link>
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Fluid</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/project">
                <i class="iconfont icon-books"></i>
                项目
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/images/docx%E5%BA%93Table%E8%B8%A9%E5%9D%91/background.svg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="docx库Table踩坑">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2022-11-11 11:20" pubdate>
        2022年11月11日 上午
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.6k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      8 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">docx库Table踩坑</h1>
            
            <div class="markdown-body">
              <h2 id="docx库Table踩坑"><a href="#docx库Table踩坑" class="headerlink" title="docx库Table踩坑"></a>docx库Table踩坑</h2><h2 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h2><p>最近工作中遇到了需要导出<code>word</code>文档的需求，只是简单的将列表详情的数据导出成<code>word</code>中的表格。<br>类似于下面的效果：</p>
<table>
<thead>
<tr>
<th>标题</th>
<th>内容</th>
</tr>
</thead>
<tbody><tr>
<td>标题</td>
<td>内容</td>
</tr>
<tr>
<td>标题</td>
<td>内容</td>
</tr>
</tbody></table>
<p>之后找到了相关的工具库<a target="_blank" rel="noopener" href="https://github.com/dolanmiu/docx">docx</a>。<br>功能强大，他封装了<code>word</code>中的相关模块的构造方法，只需要简单的创建一个对象就可以生成<code>word</code>文档。<br>其中的一些构造方法有<code>Document</code>、<code>Table</code>、<code>Paragraph</code>、<code>TextRun</code>等。  </p>
<h2 id="正文"><a href="#正文" class="headerlink" title="正文"></a>正文</h2><p>接着就正式开始嘎嘎一顿操作。  </p>
<h3 id="简单实现"><a href="#简单实现" class="headerlink" title="简单实现"></a>简单实现</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">import</span> &#123;<br>  Document,<br>	Table,<br>	TableCell,<br>	TableRow,<br>	Paragraph,<br>	VerticalAlign,<br>	WidthType,<br>	TableLayoutType,<br>&#125; <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;docx&#x27;</span><br><br><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">exportDocx</span>(<span class="hljs-params">filename, value</span>) </span>&#123;<br>  <span class="hljs-keyword">const</span> table = <span class="hljs-keyword">new</span> Table(&#123;<br>    <span class="hljs-attr">rows</span>: value.reduce(<span class="hljs-function">(<span class="hljs-params">acc, item</span>) =&gt;</span> &#123;<br>			<span class="hljs-keyword">const</span> &#123; key, value &#125; = item<br>			<span class="hljs-keyword">if</span> (<span class="hljs-built_in">Array</span>.isArray(value)) &#123;<br>				acc.push(<br>					...value.map(<span class="hljs-function">(<span class="hljs-params">item, index</span>) =&gt;</span> &#123;<br>						<span class="hljs-keyword">return</span> <span class="hljs-keyword">new</span> TableRow(&#123;<br>							<span class="hljs-attr">children</span>: [<br>								...(index == <span class="hljs-number">0</span><br>									? [<br>											<span class="hljs-keyword">new</span> TableCell(&#123;<br>												<span class="hljs-attr">rowSpan</span>: value.length,<br>												<span class="hljs-attr">children</span>: [<br>													<span class="hljs-keyword">new</span> Paragraph(&#123;<br>														<span class="hljs-attr">text</span>: key,<br>													&#125;),<br>												],<br>												<span class="hljs-attr">verticalAlign</span>: VerticalAlign.CENTER,<br>											&#125;),<br>									  ]<br>									: []),<br>								<span class="hljs-keyword">new</span> TableCell(&#123;<br>									<span class="hljs-attr">children</span>: [<br>										<span class="hljs-keyword">new</span> Paragraph(&#123;<br>											<span class="hljs-attr">text</span>: item,<br>										&#125;),<br>									],<br>									<span class="hljs-attr">verticalAlign</span>: VerticalAlign.CENTER,<br>								&#125;),<br>							],<br>						&#125;)<br>					&#125;)<br>				)<br>			&#125; <span class="hljs-keyword">else</span> &#123;<br>				acc.push(<br>					<span class="hljs-keyword">new</span> TableRow(&#123;<br>						<span class="hljs-attr">children</span>: [<br>							<span class="hljs-keyword">new</span> TableCell(&#123;<br>								<span class="hljs-attr">children</span>: [<br>									<span class="hljs-keyword">new</span> Paragraph(&#123;<br>										<span class="hljs-attr">text</span>: key,<br>									&#125;),<br>								],<br>								<span class="hljs-attr">verticalAlign</span>: VerticalAlign.CENTER,<br>							&#125;),<br>							<span class="hljs-keyword">new</span> TableCell(&#123;<br>								<span class="hljs-attr">children</span>: [<br>									<span class="hljs-keyword">new</span> Paragraph(&#123;<br>										<span class="hljs-attr">text</span>: value,<br>									&#125;),<br>								],<br>								<span class="hljs-attr">verticalAlign</span>: VerticalAlign.CENTER,<br>							&#125;),<br>						],<br>					&#125;)<br>				)<br>			&#125;<br>			<span class="hljs-keyword">return</span> acc<br>		&#125;, [])<br>  &#125;)<br>&#125;<br><br></code></pre></td></tr></table></figure>

<p>简单试试：  </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs js">exportDocx(<span class="hljs-string">&#x27;example.docx&#x27;</span>, [<br>  &#123;<br>    <span class="hljs-attr">key</span>: <span class="hljs-string">&quot;title1&quot;</span>,<br>    <span class="hljs-attr">value</span>: <span class="hljs-string">&quot;value1&quot;</span><br>  &#125;,<br>  &#123;<br>    <span class="hljs-attr">key</span>: <span class="hljs-string">&quot;title2&quot;</span>,<br>    <span class="hljs-attr">value</span>: [<br>      <span class="hljs-string">&quot;value2-1&quot;</span>,<br>      <span class="hljs-string">&quot;value2-2&quot;</span>,<br>      <span class="hljs-string">&quot;value2-3&quot;</span><br>    ]<br>  &#125;<br>])<br></code></pre></td></tr></table></figure>
<img src="/images/docx库Table踩坑/docx-1.jpg" srcset="/img/loading.gif" lazyload />  

<p>看着没啥问题，但是他没有撑满整个文档。<br>给<code>Table</code>加个宽度。  </p>
<ul>
<li>因为存在一个标题存在多条数据的情况，所以需要使用到<code>rowSpan</code>，和html<code>table</code>同理。  </li>
<li><code>verticalAlign</code>，内容垂直对齐方式。  </li>
<li><code>Paragraph</code>段落内容，可以当成文字使用。  </li>
<li><code>TableRow</code>，等同于html的<code>tr</code>  </li>
<li><code>TableCell</code>，等同于html的<code>td</code>  </li>
</ul>
<h3 id="添加宽度"><a href="#添加宽度" class="headerlink" title="添加宽度"></a>添加宽度</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">new</span> Table(&#123;<br>  <span class="hljs-attr">width</span>: &#123;<br>    <span class="hljs-attr">type</span>: WidthType.PERCENTAGE,<br>    <span class="hljs-attr">size</span>: <span class="hljs-number">100</span> <br>  &#125;<br>&#125;)<br></code></pre></td></tr></table></figure>
<img src="/images/docx库Table踩坑/docx-2.jpg" srcset="/img/loading.gif" lazyload />  

<ul>
<li>WidthType 是一些宽度类型的枚举值<code>AUTO(default) | PERCENTAGE(百分比) | NIL(空) | DXA(二十分之一点)</code>  </li>
<li>关于这个<code>DXA</code>单位，大致看下<a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_36053926/article/details/112532485">这里</a>。  </li>
</ul>
<p>看着没问题。 再试试多加点内容的情况👍。  </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs js">exportDocx(<span class="hljs-string">&#x27;example.docx&#x27;</span>, [<br>  &#123;<br>    <span class="hljs-attr">key</span>: <span class="hljs-string">&quot;title1&quot;</span>,<br>    <span class="hljs-attr">value</span>: <span class="hljs-string">&quot;value1&quot;</span>.repeat(<span class="hljs-number">50</span>)<br>  &#125;,<br>  &#123;<br>    <span class="hljs-attr">key</span>: <span class="hljs-string">&quot;title2&quot;</span>,<br>    <span class="hljs-attr">value</span>: [<br>      <span class="hljs-string">&quot;value2-1&quot;</span>,<br>      <span class="hljs-string">&quot;value2-2&quot;</span>,<br>      <span class="hljs-string">&quot;value2-3&quot;</span><br>    ]<br>  &#125;<br>])<br></code></pre></td></tr></table></figure>

<img src="/images/docx库Table踩坑/docx-3.jpg" srcset="/img/loading.gif" lazyload />   

<p>有点问题，文字多的那一栏，宽度超出了太多。<br>并且在钉钉里看到的预览效果是这样的。  </p>
<img src="/images/docx库Table踩坑/docx-4.jpg" srcset="/img/loading.gif" lazyload />

<div align="center">
<img src="/images/docx库Table踩坑/emoji-1.jpg" srcset="/img/loading.gif" lazyload />   
</div>

<p>在仓库里逛了会儿<code>issue</code>找到了对应的问题。<br><a target="_blank" rel="noopener" href="https://github.com/dolanmiu/docx/issues/349">解决办法-1</a>。<br><a target="_blank" rel="noopener" href="https://github.com/dolanmiu/docx/issues/1139">解决办法-2</a>。    </p>
<ul>
<li>不再使用百分比宽度，而是使用<code>DXA</code>宽度。  </li>
<li>将<code>Table</code>的宽度设置成0，并且规定其列数和列宽。  </li>
<li>设置<code>Table</code>的<code>layout</code>为<code>FIXED</code>。  </li>
</ul>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-keyword">new</span> Table(&#123;<br>  <span class="hljs-attr">layout</span>: TableLayoutType.FIXED,<br>	<span class="hljs-attr">columns</span>: <span class="hljs-number">3</span>,<br>	<span class="hljs-attr">width</span>: <span class="hljs-number">0</span>, <br>	<span class="hljs-attr">columnWidths</span>: [<span class="hljs-number">3213</span>, <span class="hljs-number">3213</span>, <span class="hljs-number">3212</span>] <span class="hljs-comment">// total page width is 9638 DXA for A4 portrait</span><br>&#125;)<br></code></pre></td></tr></table></figure>
<p>关于上面宽度设置成<strong>0</strong>的问题，打开<code>word</code>文档查看：<br><img src="/images/docx库Table踩坑/表格大小.jpg" srcset="/img/loading.gif" lazyload /><br>虽然指定宽度的按钮未被选中，但是在钉钉中依旧生效了。<br>将其指定为<code>0</code>保证完全不受影响。<br>设置<code>Table</code>的<code>layout</code>为<code>FIXED</code>，表示固定尺寸，防止单元格被压缩变形。<br>关于<code>DXA</code>的问题，个人猜测是可能百分比不被识别。  </p>
<p>最后附上完整的例子。  </p>
<div
    src="https://stackblitz.com/edit/js-485wx8?file=index.js"
    class="iframe-viewer-button"
>点击查看代码</div>

<img src="/images/docx库Table踩坑/docx-5.jpg" srcset="/img/loading.gif" lazyload />


<h2 id="结束"><a href="#结束" class="headerlink" title="结束"></a>结束</h2><p>简单记录下此次使用<a target="_blank" rel="noopener" href="https://github.com/dolanmiu/docx">docx</a>的踩坑。  </p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/%E5%AF%BC%E5%87%BA/">导出</a>
                    
                      <a class="hover-with-bg" href="/categories/%E5%AF%BC%E5%87%BA/%E5%89%8D%E7%AB%AF/">前端</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/docx-word/">docx word</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2022/10/24/%E6%AF%8F%E6%97%A5%E8%BF%9B%E6%AD%A5%E5%B0%8F%E8%AE%B0-1/">
                        <span class="hidden-mobile">每日进步小记</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> <div style="font-size: 0.85rem"> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/js/duration.js"></script> <script src="/js/code-viewer.js"></script> </div> 
  </div>
  
  <div class="statistics">
    
    

    
      
        <!-- 不蒜子统计PV -->
        <span id="busuanzi_container_site_pv" style="display: none">
            总访问量 
            <span id="busuanzi_value_site_pv"></span>
             次
          </span>
      
      
        <!-- 不蒜子统计UV -->
        <span id="busuanzi_container_site_uv" style="display: none">
            总访客数 
            <span id="busuanzi_value_site_uv"></span>
             人
          </span>
      
    
  </div>


  

  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


<!-- hexo injector body_end start -->
  <script src="//cdn.jsdelivr.net/gh/bynotes/texiao/source/js/xiantiao.js"></script>
  <script src="//cdn.jsdelivr.net/gh/bynotes/texiao/source/js/xiaoxingxing.js"></script>
  <script src="//cdn.jsdelivr.net/gh/bynotes/texiao/source/js/dianjichuzi.js"></script>
<!-- hexo injector body_end end --><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"right","width":150,"height":300,"mobile":{"show":true}},"log":false});</script></body>
</html>
